package com.xihua.sx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xihua.sx.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    //登录接口
    @Select("SELECT * FROM `user` WHERE user.`username`=#{username} AND user.`password`=#{password} ")
    User login(@Param("username") String username,
               @Param("password") String password);
    @Insert("insert into user(username,password)values(#{username},#{password})")
    void saveUser(@Param("username") String name, @Param("password") String password);


}
